package com.dayu.metro.domain;

import javax.persistence.ManyToOne;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.jpa.activerecord.RooJpaActiveRecord;
import org.springframework.roo.addon.tostring.RooToString;

@RooJavaBean
@RooToString
@RooJpaActiveRecord(identifierField = "username", finders = { "findUsersesByGroups" })
public class Users {

    @NotNull
    @Size(max = 20)
    private String username;

    @NotNull
    @Size(max = 20)
    private String lastname;

    @NotNull
    @Size(max = 20)
    private String firstname;

    @NotNull
    @Size(min = 6, max = 20)
    private String password;

    @NotNull
    private Boolean enabled;

    @ManyToOne
    private Groups groups;
}
